<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>实例：骰子练习</title>
		<style type="text/css">
			html,body{
				height: 100%;
			}
			body{
				background: #131313;
				display: flex;
				justify-content: center;
				align-items: center;
			}
			.touzi{
				box-sizing: border-box;
				width: 110px;
				height: 110px;
				padding: 5px;
				background: #F4F4F4;
				border-radius: 5px;
				margin: 10px;
				box-shadow: inset 5px 5px #FFFFFF,inset -5px -5px #E4E3E2;
				display: flex;
			}
			.item{
				width: 25px;
				height: 25px;
				border-radius: 50%;
				background: #333;
				box-shadow: inset 0 -3px #555;
			}
			/*以下是骰子的具体设置*/
			.touzi-1{
				justify-content: center;
				align-items: center;
			}
			/*骰子1实际上也练习了常见的垂直居中例子*/
			
			
			.touzi-2{
				justify-content: space-between;
			}
			.touzi-2 .item:first-child{
				align-self: flex-start;			
			}
			.touzi-2 .item:last-child{
				align-self: flex-end;			
			}			
			/*骰子2重点：子项的align-self的优先级*/


			.touzi-3{
				justify-content: space-between;
			}
			.touzi-3 .item:first-child{
				align-self: flex-start;			
			}
			.touzi-3 .item:nth-child(2){
				align-self: center;			
			}			
			.touzi-3 .item:last-child{
				align-self: flex-end;			
			}			
			
			
			.touzi-4{
				flex-flow: column;
				justify-content: space-between;				
			}	
			.touzi-4>div{
				/*border: 1px red solid;*/
				display: flex;
				justify-content: space-between;
			}
			/*骰子4重点：1、根据需求分析，修改html结构；2、根据需求分析，调整flex容器的主轴方向；3、由于具有了多重嵌套的flex对象，所以要注意其父子级别的关系 */
			
			
			.touzi-5{
				flex-flow: column;
				justify-content: space-between;				
			}	
			.touzi-5>div{
				/*border: 1px red solid;*/
				display: flex;
				justify-content: space-between;
			}
			.touzi-5>div:nth-child(2){
				justify-content: center;				
			}
			
			
			.touzi-6{
				flex-flow: column;
				justify-content: space-between;				
			}	
			.touzi-6>div{
				/*border: 1px red solid;*/
				display: flex;
				justify-content: space-between;
			}			
			
		</style>
	</head>
	<body>
		<div class="touzi touzi-1">
			<span class="item"></span>
		</div>
		<div class="touzi touzi-2">
			<span class="item"></span>
			<span class="item"></span>
		</div>
		<div class="touzi touzi-3">
			<span class="item"></span>
			<span class="item"></span>
			<span class="item"></span>
		</div>
		<div class="touzi touzi-4">
			<div>
				<span class="item"></span>
				<span class="item"></span>		
			</div>
			<div>
				<span class="item"></span>
				<span class="item"></span>		
			</div>
		</div>
		<div class="touzi touzi-5">
			<div>
				<span class="item"></span>
				<span class="item"></span>		
			</div>
			<div>
				<span class="item"></span>
			</div>			
			<div>
				<span class="item"></span>
				<span class="item"></span>		
			</div>
		</div>
		<div class="touzi touzi-6">
			<div>
				<span class="item"></span>
				<span class="item"></span>		
			</div>
			<div>
				<span class="item"></span>
				<span class="item"></span>		
			</div>
			<div>
				<span class="item"></span>
				<span class="item"></span>		
			</div>
		</div>
	</body>
</html>
